package cn.wgx.module.mind.util;

import cn.wgx.common.entity.mind.MindProject;
import cn.wgx.common.security.client.config.entity.LoginAppUser;
import cn.wgx.common.security.util.SysUserUtil;
import cn.wgx.common.util.SpringUtils;
import cn.wgx.module.mind.service.ProjectService;

public class ProjectUtil {

    private static ProjectService projectService = SpringUtils.getBean(ProjectService.class);

    public static MindProject getById(Integer pro_id){
        return projectService.getById(pro_id);
    }

    public static boolean isCreateUser(Integer pro_id){
        MindProject byId = getById(pro_id);
        if(byId != null){
            LoginAppUser loginAppUser = SysUserUtil.getLoginAppUser();
            if(loginAppUser != null){
                if(byId.getCreateUserId().equals(loginAppUser.getUser_id())){
                    return true;
                }
            }
        }
        return false;
    }

}
